<?php if(!defined('SIDELOADED')) { echo 'Direct access is not allowed.'; }?>
    <script>
      $(document).ready(function() {
        if($('#registerCheck').attr('checked')) {
          $('#registerOptionPassword').attr('required');
          $('#registerOptionUsername').attr('required');
          $('#registerOptionKey').attr('required');
          $('#registerOptions').show();
          $('#submit').val('Register');
        }
        $('#registerCheck').click(function() {
          if($('#registerCheck').attr('checked')) {
            $('#registerOptionPassword').attr('required');
            $('#registerOptionUsername').attr('required');
            $('#registerOptionKey').attr('required');
            $('#registerOptions').slideDown();
            $('#submit').val('Register');
          } else {
            $('#registerOptionPassword').removeAttr('required');
            $('#registerOptionUsername').removeAttr('required');
            $('#registerOptionKey').removeAttr('required');
            $('#registerOptions').slideUp();
            $('#submit').val('Login');
          }
        })
      });
    </script>
